package com.example.demo.repository;


import com.example.demo.entity.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 *   @Repository 必须加上
 *   必须继承  extends JpaRepository<User,Long>
 */
@Repository
public interface UserRepository extends JpaRepository<User,Long> {

    User save(User user);

    User findByUsername(String username);

    List<User> findAll();
}
